/**
 * js中需要继承的都定义在原型链上
 * Person
 * @param{string} name
 */

function Person(name){
    this.name = name;
}

//继承的属性
Person.prototype.attr=1;

/**
 * 
 * SayHello函数
 * @param{string}
 */
Person.prototype.sayHello =function(){
    return '大家好，我是${this.name}';
}
/**
 * walk函数
 * @returns{string} 
 * 
 */
Person.prototype.walk = function(){
    return '动起来'
}
 
function  Teacher(name,teachers){
    Person.call(this,name);//
    this.teachers = teachers;
}
//组合继承
//确保Teacher原型链继承Person的原型链
Teacher.prototype = Object.create(Person.prototype);
//确保Teacher构造函数的正确指向Teacher构造函数
Teacher.prototype.constructor = Teacher;

Teacher.prototype.sayHello = function(){
    return '大家好，我是${this.name},教《${this.teacher}》'
}